package cn.smart.util;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * @author Xiezh
 * @Description: 时间工具
 * @create 2017/7/31
 */
public class TimeUtil {
    //精确到秒的时间
    public static String getTimeToSecond(Date date) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return format.format(date);
    }

    //精确到日的时间
    public static String getTimeToDay(Date date) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        return format.format(date);
    }
}
